import { createStore } from 'vuex'

export default createStore({
    state: {
        // 定义状态
        username: '',
    },
    getters: {
        // 定义getter
        getUsername: state => state.username,
    },
    mutations: {
        // 定义mutations
        setUsername(state, username) {
            state.username = username
        }
    },
    actions: {
        // 定义actions
    },
    modules: {
        // 定义模块
    }
}) 